function setCookie (name, value) {
    if (value) {
        var exp = new Date()
        exp.setTime(exp.getTime() + 60 * 60 * 1000)
        document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString()
    }
}
function delCookie (name) {
    var exp = new Date()
    exp.setTime(exp.getTime() - 1)
    var cval = setCookie(name)
    if (cval && cval != null) {
        document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString()
    }
}